/*package com.yfyszk.kingbird.config;


import com.alibaba.fastjson.JSON;
import com.yfyszk.kingbird.common.exception.BizCodeEnum;
import com.yfyszk.kingbird.common.utils.R;
import org.springframework.context.annotation.Configuration;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

*//**
 * @Description:  本源码分享自 www.cx1314.cn   欢迎访问获取更多资源 自定义阻塞返回方法
 * @Created: 程序源码论坛
 * @author: cx
 * @createTime: 2020-07-13 11:30
 **//*

@Configuration
public class SearchSentinelConfig {

    public SearchSentinelConfig() {

        WebCallbackManager.setUrlBlockHandler(new UrlBlockHandler() {
            @Override
            public void blocked(HttpServletRequest request, HttpServletResponse response, BlockException ex) throws IOException {
                R error = R.error(BizCodeEnum.TO_MANY_REQUEST.getCode(), BizCodeEnum.TO_MANY_REQUEST.getMessage());
                response.setCharacterEncoding("UTF-8");
                response.setContentType("application/json");
                response.getWriter().write(JSON.toJSONString(error));

            }
        });

    }

}*/
